<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>商品管理</title>
		<link rel="stylesheet" type="text/css" href="css/spgl2.css"/>
	</head>
	<body>
		<div class="main_content">
			<div class="con_left">
				<div class="l-box in">
					<a href="spgl.html">商品管理</a>
				</div>
			</div>
			<div class="con_right fl">
				<header>编辑商品</header>
				<div class="r_main">
					<form action="" method="post" id="form1">
						<div class="group-radio">
							<div class="i-radio d-i-b">
							商品类型：
								<div class="f-inp-r" style="margin-left: 80px;">
									<input type="radio" name="zhuangtai" checked="checked"/><i class="ii"></i>
								</div>
								<span>会员充值</span>
							</div>
							<div class="i-radio d-i-b">
								<div class="f-inp-r">
									<input type="radio" name="zhuangtai"/><i></i>
								</div>
								<span>非会员商品</span>
							</div>
							<div class="i-radio d-i-b">
								<div class="f-inp-r">
									<input type="radio" name="zhuangtai"/><i></i>
								</div>
								<span>会员商品</span>
							</div>
							<div class="i-radio d-i-b">
								<div class="f-inp-r">
									<input type="radio" name="zhuangtai"/><i></i>
								</div>
								<span>洗车机会费</span>
							</div>
							<div class="i-radio d-i-b">
								<div class="f-inp-r">
									<input type="radio" name="zhuangtai"/><i></i>
								</div>
								<span>售水机会费</span>
							</div>
						</div>
						<div class="info-con">
							<p>标题：</p>
							<input type="text" name="input1"  value="充值100元送10元" class="required">
						</div>
						<div class="info-con">
							<p>描述：</p><textarea></textarea>
						</div>
						<div class="info-con">
							<p>金额：</p>
							<input type="text" name="input2"  value="100" style="width: 100px;" class="required integer">元
						</div>
						<div class="info-con">
							<p>赠送金额：</p><input type="text" name="" id="input4" value="10" style="width: 100px;"class="integer">元
						</div>
						<div class="info-con">
							<p>允许订单数量：</p>
							<input type="text" name="input3" id="" value="0" style="width: 100px;" maxlength="3" class="required range"><span>0表示不限次数 </span>
						</div>
						<div class="info-con">
							<p>是否启用：</p><input type="checkbox" name="" id="" >
						</div>
						<div class="uploadLogo">
							<p>商品图片：</p>
							<div>
								<span style="color:black">选择文件：<em>未选择任何文件</em></span>
								<input type="file" name="" id="inputs" value="" />
								<img src="img/shangchuanlogo.jpg" alt="" />
								<div id='dd'></div>
								<span>格式：bmp/gif/jpeg/jpg/png<br />建议图片尺寸：xxpx × 50px</span>
								<button>上传</button>
							</div>
						</div>
						<div class="info-con">
							<p>备注：</p><input type="text" name="" id="" value="" class="">
						</div>
						<div class="btn-center" align="center">
							<input type="submit" name="" id="" value="保存" class="btn"/>
							<input type="button" name="" id="" value="返回" class="btn back" onclick="window.location.href='spgl.html'"/>
						</div>
					</form>
				</div>
			</div>
		
		<script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/index.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/dtjk.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/distpicker.data.js"></script>
		<script src="js/distpicker.js"></script>
		<script src="js/main.js"></script>
		<script src="js/validate.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
		$().ready(function() {
			$("#form1").validate({
		 		debug:true,
		 		ignore: ".ignore",
		 		errorPlacement: function(error, element) {  
				    error.appendTo(element.parent());  
				},
		        rules: {
					input1:"required",
					input2:{
						required:true,
						integer:true
					},
					input3:{
						required:true,
						range:[0,255]
					}
			   	},
		        messages: {
				   input1:{
		       	       required:'*'
				   },
				   input2:{
		       	       required:'*'
				   },
				   input3:{
		       	       required:'*',
		       	       range:'设定范围:0-255'
				   },
		  		}
		    });
		});
		jQuery.validator.addMethod("integer", function (value, element) {
		    var tel =/^\d+(\.{0,1}\d+){0,1}$/; 
		    return this.optional(element) || (tel.test(value));
		}, "格式错误！"); 
		jQuery.validator.addMethod("isZipCode", function(value, element) {   
		    var tel = /^[0-9]{6}$/;
		    return this.optional(element) || (tel.test(value));
		}, "请正确填写您的邮政编码");
		</script>
	</body>
</html>
